<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <input type="text" name="" id="result">
    <button id="btn">评价</button>
    <input type="text" name="" id="num">
    <input type="text" name="" id="result1">
    <button id="btn1">评价</button>
    <input type="text" name="" id="num1">
    <script>
        document.getElementById("btn").onclick = function() {
            _result = Number(document.getElementById("result").value);
            if (_result > 90) {
                document.getElementById("num").value = "优"
            } else if (_result < 90 && _result > 80) {
                document.getElementById("num").value = "良"
            } else if (_result < 80 && _result > 70) {
                document.getElementById("num").value = "中"
            } else if (_result < 70 && _result > 60) {
                document.getElementById("num").value = "及格"
            } else if (_result < 60 && _result !== 0) {
                document.getElementById("num").value = "不及格"
            } else {
                document.getElementById("num").value = "请输入"
            }
        }
        document.getElementById("btn1").onclick = function() {
            var _result1 = Number(document.getElementById("result1").value);
            switch (_result1) {
                case _result1 = 90:
                    document.getElementById("num1").value = "优";
                    break;
                case _result1 = 80:
                    document.getElementById("num1").value = "良";
                    break;
                case _result1 = 70:
                    document.getElementById("num1").value = "及格";
                    break;
                case _result1 = 60:
                    document.getElementById("num1").value = "不及格";
                    break;
                default:
                    document.getElementById("num1").value = "错误";
                    break;
            }
        }
    </script>
</body>

</html>